#include <bits/stdc++.h>

using namespace std;

int main()
{
    priority_queue<int> q;
    vector<int> arr;
    int n, k;
    cin >> n >> k;
    for (int i = 0; i < n; i++)
    {
        int tmp;
        cin >> tmp;
        if (tmp % 2 == 0) q.push(tmp);
        else arr.push_back(tmp);
    }
    while (k-- && !q.empty())
    {
        int tmp = q.top();
        q.pop();
        tmp /= 2;
        if (tmp % 2 == 0) q.push(tmp);
        else arr.push_back(tmp);
    }
    long long sum = 0;
    for (auto num : arr) sum += num;
    while (!q.empty())
    {
        sum += q.top();
        q.pop();
    }
    cout << sum << endl;

    return 0;
}